package com.ydj.app.entity.query;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ydj.app.enumerate.ForecastQuestionCateEnum;
import com.ydj.framework.mysql.BaseQuery;
import com.ydj.app.entity.ForecastResult;
import com.ydj.framework.mysql.MysqlSort;

import java.util.Date;
import java.util.List;

public class ForecastResultQuery extends BaseQuery<ForecastResult> {
    public ForecastResultQuery(IService<ForecastResult> service) {
        super(service);
    }

    public ForecastResultQuery id(Long id) {
        eq(ForecastResult::getId, id);
        return this;
    }

    public ForecastResultQuery ids(List<Long> value) {
        in(ForecastResult::getId, value);
        return this;
    }

    public ForecastResultQuery cate(ForecastQuestionCateEnum value) {
        eq(ForecastResult::getCate, value);
        return this;
    }

    public ForecastResultQuery createTime(Date value1, Date value2) {
        between(ForecastResult::getCreateTime, value1, value2);
        return this;
    }

    public ForecastResultQuery orderByCreateTimeDesc() {
        orderBy(ForecastResult::getCreateTime, MysqlSort.DESC);
        return this;
    }
}